<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>博客首页</title>
<link rel="stylesheet" href="/layui/css/layui.css">
<link rel="stylesheet" href="/css/css1.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <!-- 头部区域（可配合layui已有的水平导航） -->
     <div class="header">
     <h1>博客系统首页</h1>
     <?php if(empty($username)): ?>
      <a href="login.php" class="layui-btn ">登入</a>
      <a href="view/register.tpl.php" class="layui-btn ">注册</a>
     <?php else: ?>    
      <a href="logout.php" class="layui-btn ">退出</a>
      <a href="" class="layui-btn "><?php echo $_SESSION["username"].",欢迎您"?></a>       
     <?php endif; ?>     
     </div> 
  </div>
  <div class="layui-side layui-bg-black">
   <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree" lay-filter="demo">
        <li class="layui-nav-item layui-nav-itemed">
          <a href="javascript:;">默认展开</a>
          <dl class="layui-nav-child">
          <?php
            foreach($kinds as $val){
          ?>
            <dd><a href="index.php?id=<?php echo $val["id"]?>"><?php echo $val['king']?></a></dd>     
          <?php 
           }
          ?>  
          </dl>
        </li>  
      </ul>
 </div>
  </div>
  <div class="layui-body">
   <!-- <?php echo $kid?> -->
      <ul>
      <?php      
        foreach($indexs as $val){
      ?>
       <a href="article.php?id=<?php echo $val["id"]?>&&kid=<?php echo $val["kid"]?>"><li><?php echo $val["title"]?></li></a>  
       <?php
         }
       ?>
      </ul> 
     

  </div>
  <div class="layui-footer">
    <!-- 底部固定区域 -->
  </div>
</div>
<script src="/layui/layui.js"></script>
<script>
//JavaScript代码区域
layui.use('element', function(){
  var element = layui.element(); //导航的hover效果、二级菜单等功能，需要依赖element模块
});
</script>
</body>
</html>